package com.ruoyi;

import com.ruoyi.project.flink.latest.MySink;
import org.apache.flink.streaming.api.datastream.DataStream;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;
import org.apache.flink.streaming.api.functions.source.SourceFunction;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration;
import org.springframework.boot.autoconfigure.security.servlet.SecurityAutoConfiguration;

import java.util.concurrent.Future;

/**
 * 启动程序
 * 
 * @author ruoyi
 */
@SpringBootApplication(exclude = { DataSourceAutoConfiguration.class , SecurityAutoConfiguration.class})
@MapperScan("com.ruoyi.project.test.gds.formal.mapper")
public class RuoYiApplication
{
    public static void main(String[] args) throws Exception
    {
        // System.setProperty("spring.devtools.restart.enabled", "false");
        SpringApplication.run(RuoYiApplication.class, args);
        System.out.println("(♥◠‿◠)ﾉﾞ  若依启动成功   ლ(´ڡ`ლ)ﾞ  \n" +
                " .-------.       ____     __        \n" +
                " |  _ _   \\      \\   \\   /  /    \n" +
                " | ( ' )  |       \\  _. /  '       \n" +
                " |(_ o _) /        _( )_ .'         \n" +
                " | (_,_).' __  ___(_ o _)'          \n" +
                " |  |\\ \\  |  ||   |(_,_)'         \n" +
                " |  | \\ `'   /|   `-'  /           \n" +
                " |  |  \\    /  \\      /           \n" +
                " ''-'   `'-'    `-..-'              ");
//        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
//        // 有限的流
//        // DataStream<String> stream = env.fromElements("1", "2", "3");
//        // 这里模拟一个持续发送数据的源
//        DataStream<String> stream = env.addSource(new SourceFunction<String>() {
//
//            @Override
//            public void run(SourceContext<String> sourceContext) throws Exception {
//                long c = 0;
//                while(true) {
//                    sourceContext.collect("test"+ c++);
//                    Thread.sleep(3000);
//                }
//            }
//
//            @Override
//            public void cancel() {}
//        });
//
//        stream.addSink(new MySink());
//        env.execute("spring flink demo");
    }

}